{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">新建学生考勤表</h3>
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">年级</td>
			<td>
				<!-- <input type="text" name="nianji"  value="" autocomplete="off" placeholder="请输入年级" class="layui-input"> -->
				<select name="nianji"  lay-reqText="请选择年級">
					
					{volist name=":get_nianji()" id="v"}
					<option value="{$v.id}" >{$v.nianji} </option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray-2">班级</td>
			<td><input type="text" name="banji"  value="" autocomplete="off" placeholder="请输入班级" class="layui-input"></td>
		</tr>
		<tr><td class="layui-td-gray-2">应到人数</td>
			<td><input type="text" name="yingdao"  value="" autocomplete="off" placeholder="请输入应到人数" class="layui-input"></td><td class="layui-td-gray-2">实到人数<font>*</font></td>
			<td><input type="text" name="shidao"  lay-verify="required" lay-reqText="请完善实到人数" value="" autocomplete="off" placeholder="请输入实到人数" class="layui-input"></td>
		</tr>
		<tr>
			<td class="layui-td-gray-2">时间</td>
			<td><input type="text" name="create_time"  value="" readonly id="laydate_create_time" autocomplete="off" placeholder="请选择" class="layui-input"></td>
		</tr>
				
	</table>
	<div class="pt-3">
		<input type="hidden" name="id" value="0"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		//日期选择
		layui.laydate.render({
			elem: '#laydate_create_time' //指定元素
			,type:'date'
		});
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/student_kaoqin/add", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->